<?php

namespace App\Http\Requests\App\V1\AppVersion;

use App\Http\Requests\ApiRequest;
use App\Models\AppVersion;
use Illuminate\Validation\Rule;

/**
 * @property string download_url
 * @property string version
 * @property string description
 * @property string force_update
 * @property string platform
 */
class AppVersionStoreRequest extends ApiRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'download_url' => 'required|string',
            'version'      => 'required|string',
            'description'  => 'required|string',
            'force_update' => 'required|int',
            'platform'     => ['required', 'int', Rule::in(AppVersion::VALID_PLATFORMS)],
        ];
    }
}
